#include <stdio.h>
#include <string.h>
int CountWordAndReplaceBlank(char string[])//1
{	  	 	 	   		 
    int i = 0,  numofBlank = 0, j = 0;//1
    int len = strlen(string);//1
    for (i = 0; i < len; i++)//2
    {	  	 	 	   		 
        if (string[i] == ' ')//2
        {	  	 	 	   		 
            numofBlank++;//1
            string[i] = '*';//1
        }
    }
    return numofBlank + 1; //1
}	  	 	 	   		 
int main()
{	  	 	 	   		 
    char str[100];
    int numofBlank;
    printf("input the string:");
    gets(str);//1
    numofBlank = CountWordAndReplaceBlank(str); //1
    printf("Numbers of words = %d\n", numofBlank); //1
    printf("the answer:%s\n", str);//1
    return 0;
}